﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VK.Casemeet.Lines;
using VK.Comm.TransactSql;
using System.Data;

namespace VK.Casemeet.Web.Front.Controls
{
    public partial class TopLine : System.Web.UI.UserControl
    {
        public string AreaUrl { set; get; }
        public string SortField { set; get; }
        public int ProvinceID { set; get; }
        public int CityID { set; get; }

        public int num = 1;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rptLine.DataSource = LineBLL.GetLineList(1, 10, new List<Condition>(){
                    new Condition { TableName = "Shop", FieldName = "ProvinceID", ConditionType = ConditionType.NumeralEqual, ConditionValue = ProvinceID, DbType = DbType.Int32 },
                    new Condition { TableName = "Shop", FieldName = "CityID", ConditionType = ConditionType.NumeralEqual, ConditionValue = CityID, DbType = DbType.Int32 },
                    new Condition { TableName = "Line", FieldName = "IsEnable", ConditionType = ConditionType.BoolEqual, ConditionValue = true, DbType = DbType.Boolean }
                }, SortField, SortMode.Desc);
                rptLine.DataBind();
            }
        }
    }
}